package com.xinliu.fastchat.config;

/*
 @author: xinliu
 @email: 3536370493@qq.com
 @time : 2025/9/23 12:59
*/

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class CrossConfig implements WebMvcConfigurer {


    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")
                .allowedOrigins("*")
                .allowedMethods("GET", "POST", "DELETE", "PUT", "OPTIONS")
                .exposedHeaders("*")
                .allowCredentials(false)
                .maxAge(3600);
    }
}
